package com.swg.selector;

import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;

/**
 * 自定义逻辑返回需要导入的组件
 */
public class MyImportSelector implements ImportSelector{
    /**
     *
     * @param annotationMetadata 当前标注Import注解的类的所有注解信息
     * @return 返回值就是导入到容器中的组件的全类名
     */
    @Override
    public String[] selectImports(AnnotationMetadata annotationMetadata) {

        return new String[]{"com.swg.bean.Dog","com.swg.bean.Cat","com.swg.bean.Pig"};
    }
}
